package com.company.作业;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        System.out.println("请输入正方形边长:");
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        for (int i = 1; i <=a; i++) {
            for (int j = 1; j <=a; j++) {
                if((i==1)||(i==a)||((j==1)||(j==a))){
                    System.out.print("*");
                }
                else {
                    System.out.print(" ");
                }

            }
            System.out.println();

        }
    }
}














